package com.bite.demo.component;

import com.bite.demo.model.UserInfo;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

@Component
public class UserComponent {
    public void sayHi(){
        System.out.println("Hi,UserComponent... ");
    }


    @Bean({"u1","u2"})
    public UserInfo userInfo(){
        return new UserInfo(1, "zhangsan");
    }

//    @Primary
    @Bean
    public UserInfo userInfo2(){
        return new UserInfo(2, "lisi");
    }
}
